package myAsm;

import java.util.Map;


import javax.persistence.*;

import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;



@Entity
@DiscriminatorValue("INSN_LDC")
public class MyLdcInsnNode extends MyAbstractInsnNode {

    /**
     * The constant to be loaded on the stack. This parameter must be a non null
     * {@link Integer}, a {@link Float}, a {@link Long}, a {@link Double}, a
     * {@link String} or a {@link org.objectweb.asm.Type}.
     */
	@Transient
    public Object cst;

	public MyLdcInsnNode() {
		super(-1);
	}
	
    /**
     * Constructs a new {@link LdcInsnNode}.
     * 
     * @param cst the constant to be loaded on the stack. This parameter must be
     *        a non null {@link Integer}, a {@link Float}, a {@link Long}, a
     *        {@link Double} or a {@link String}.
     */
    public MyLdcInsnNode(final Object cst) {
        super(Opcodes.LDC);
        this.cst = cst;
    }

    public int getType() {
        return LDC_INSN;
    }

    public void accept(final MethodVisitor mv) {
        mv.visitLdcInsn(cst);
    }

    public MyAbstractInsnNode clone(final Map labels) {
        return new MyLdcInsnNode(cst);
    }
}